import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:yt_devops/components/app_bar/app_bar_widget.dart';
import 'package:yt_devops/components/yt_input.dart';
import 'package:yt_devops/resources/resources.dart';
import 'package:yt_devops/resources/str_res_keys.dart';
import 'package:yt_devops/styles/styles.dart';
import 'device_sn_controller.dart';

class DeviceSnPage extends GetView<DeviceSnController> {
  const DeviceSnPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBarWidget.defaultAppBar(ResKey.addNewDevice.tr),
      body: Column(children: [
        Container(
          constraints: BoxConstraints(minHeight: 50.h),
          color: Colour.white,
          margin: EdgeInsets.only(
            top: 10.h,
          ),
          padding: EdgeInsets.symmetric(horizontal: 16.w),
          child: YtInput(
            height: 41.h,
            labelText: ResKey.deviceSnNumber.tr,
            labelTextStyle: TextStyles.f16,
            placeholderText: ResKey.plsScanDeviceSn.tr,
            placeholderTextStyle: TextStyles.lf16,
            border: InputBorder.none,
            shifxIcon: GestureDetector(
                onTap: controller.toScan,
                child: Image.asset(ImageAssets.iconScan)),
          ),
        ),
      ]),
    );
  }
}
